﻿<Controls:Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:Controls="clr-namespace:Elysium.Theme.Controls;assembly=Elysium.Theme"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" x:Class="WP7EmulatorSwitcher.MainWindow"
        mc:Ignorable="d"
        Height="360"
        Width="520"
        Title="WP7 Emulator Skin Switcher - by Geert van der Cruijsen"
        ResizeMode="NoResize"
        >

    <Controls:Window.Resources>

        <DataTemplate x:Key="PhoneTemplate">
            <StackPanel Width="120" Height="220">
                <Image Source="{Binding SkinUpUrl}" Height="160"/>
                <TextBlock Text="{Binding Title}" HorizontalAlignment="Center"/>
                <TextBlock Text="{Binding SubTitle}" HorizontalAlignment="Center"/>
                <TextBlock Text="{Binding CreatorName}" HorizontalAlignment="Center" FontSize="10">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="MouseLeftButtonDown">
                            <ei:LaunchUriOrFileAction Path="{Binding CreatorLink}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </TextBlock>
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="SelectedPhoneTemplate">
            <StackPanel Width="120" Height="220">
                <Image Source="{Binding SkinUpUrl}" Height="160"/>
                <TextBlock Text="{Binding Title}" HorizontalAlignment="Center" FontWeight="Bold"/>
                <TextBlock Text="{Binding SubTitle}" HorizontalAlignment="Center" FontWeight="Bold"/>
                <TextBlock Text="{Binding CreatorName}" HorizontalAlignment="Center" FontSize="10">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="MouseLeftButtonDown">
                            <ei:LaunchUriOrFileAction Path="{Binding CreatorLink}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </TextBlock>
            </StackPanel>
        </DataTemplate>

        <Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
            <Style.Resources>
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
            </Style.Resources>
            <Setter Property="ContentTemplate" Value="{StaticResource PhoneTemplate}" />
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="ContentTemplate" Value="{StaticResource SelectedPhoneTemplate}" />
                </Trigger>
            </Style.Triggers>
        </Style>

    </Controls:Window.Resources>




    <Controls:Window.DataContext>
        <Binding Path="Main" Source="{StaticResource Locator}"/>
    </Controls:Window.DataContext>




    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.207*"/>
            <ColumnDefinition Width="0.793*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.ColumnSpan="2">
            <StackPanel Orientation="Horizontal"/>
            <StackPanel OverridesDefaultStyle="True">
                <ListBox ItemsSource="{Binding PhoneList}" Height="250" ScrollViewer.VerticalScrollBarVisibility="Disabled" SelectedItem="{Binding SelectedPhone, Mode=TwoWay}" ItemContainerStyle="{StaticResource ContainerStyle}" Width="490" >
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>
                <StackPanel Height="20" Width="490">
                    <TextBlock TextWrapping="Wrap" Text="{Binding LogMessages}" HorizontalAlignment="Left"/>
                </StackPanel>
                <StackPanel Height="50" Margin="-1,5,0,0" Orientation="Horizontal">
                    <Image HorizontalAlignment="Left" Height="50" Margin="3,0,0,0" Source="Images/twitter.jpg" Stretch="Fill" Width="50">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseLeftButtonDown">
                                <ei:LaunchUriOrFileAction Path="http://twitter.com/geertvdc"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Image>
                    <StackPanel Height="40" Margin="0">
                        <StackPanel Height="35" Width="445" Margin="0,6,4,0">
                            <TextBlock TextWrapping="Wrap" Text="V1.2 http://wp7emuskinswitcher.codeplex.com" Margin="0" d:LayoutOverrides="Width" HorizontalAlignment="Right">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="MouseLeftButtonDown">
                                        <ei:LaunchUriOrFileAction Path="http://wp7emuskinswitcher.codeplex.com"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0" d:LayoutOverrides="HorizontalAlignment"><Run Text="© Geert van der Cruijsen"/></TextBlock>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </StackPanel>
    </Grid>
</Controls:Window>
